package cn.sirun.com.fca.account.repo.login;

import com.tencent.cloud.iov.kernel.constant.HttpHeaderConst;
import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.base.CarInfoDetailRequest;
import cn.sirun.com.fca.account.model.base.CarInfoDetailResponse;
import cn.sirun.com.fca.account.model.login.AuthenticateRequest;
import cn.sirun.com.fca.account.model.login.AuthenticateResponse;
import cn.sirun.com.fca.account.model.login.ChallengeRequest;
import cn.sirun.com.fca.account.model.login.ChallengeResponse;
import cn.sirun.com.fca.account.model.login.LoginRequest;
import cn.sirun.com.fca.account.model.login.LoginResponse;
import cn.sirun.com.fca.account.model.login.PersonalInfo;
import cn.sirun.com.fca.account.model.login.PersonalInfoRequest;
import cn.sirun.com.fca.account.model.login.VehicleRespons;
import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.POST;

public interface LoginService {

    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v2/account/login/challenge")
    Observable<BaseResponse<ChallengeResponse>> challenge(@Body ChallengeRequest request);

    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v2/account/login/submit")
    Observable<BaseResponse<LoginResponse>> passwordLogin(@Body LoginRequest request);

    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v2/account/login/authenticate")
    Observable<BaseResponse<AuthenticateResponse>> authenticate(@Body AuthenticateRequest request);

    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v2/iam_gateway/car_management/get_all_car_status")
    Observable<BaseResponse<VehicleRespons>> getVehicle();

    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v2/profile/personal_center/get_personal_info")
    Observable<BaseResponse<PersonalInfo>> getPersonalInfo(@Body PersonalInfoRequest request);

    @Headers({HttpHeaderConst.ADD_COOKIE, HttpHeaderConst.CONTENT_TYPE_JSON})
    @POST("/v2/iam_gateway/car_management/get_car_detail")
    Observable<BaseResponse<CarInfoDetailResponse>> getCarInfoDetail(@Body CarInfoDetailRequest request);
}
